package train

import (
	"encoding/json"
	"kop/modules/configuration/client"
	"kop/util/log"
)

func init() {

	var b = client.Load("TrainCost")
	if err := json.Unmarshal(b, &Configs); err != nil {
		panic(err)
	}

	log.Info("Load TrainCost.json success.")
}

type Conf struct {
	Cost int32 // 钻石消耗
}

var Configs = map[int32]Conf{}

// 获取升级需要的钻石数量
func GetTrainCost(n int32) int32 {

	return Configs[n].Cost
}
